import React from 'react'
import "./Fill.less"
import {Getput} from "@/request/api"
import Button from '@mui/material/Button';
export default function Fill({data}:IProps) {
  const questionType:IQusType={
    many:"多选",
    one:"单选",
    check:"判断",
    qa:"问答",
    code:"编程"
  }
  const qiu = ()=>{
    Getput({
    actionType:"exam_test",
    categoryCode:data.categoryCode,
    id:data.id,
    userAnswer:"1"
  }).then(res=>{
    console.log(res);
    if(res.errCode===0){
      sessionStorage.removeItem("homedata")
    }else{

    }
  })
  }
  
  return (
    <div className='fill'>
      <div className='title'>
        <div className='type'>{questionType[data.questionType]}</div>
        <div className='qtitle'>{data.title}</div>
      </div>
      <div className='option'>
        <textarea placeholder='请输入答案' name="" id="" style={{resize:"none"}}></textarea>
      </div>
      <div className='xiaozi'>此类型的题目不支持打分,按正确计分</div>
      <div className='btn1' onClick={qiu} >确定</div>
    </div>
  )
}